package com.lfy.auth.controller;

import com.lfy.common.result.R;
import com.lfy.commons.anno.limit.CurrentLimit;
import com.lfy.commons.anno.user.NoNeedLogin;
import com.lfy.commons.strategy.LimitStrategyEnum;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
public class testController {
    @GetMapping("/test")
    @NoNeedLogin
    @CurrentLimit(time = 10,once = 5,nuit = TimeUnit.SECONDS,strategy = LimitStrategyEnum.Ip)
    @CurrentLimit(time = 1,once = 10,nuit = TimeUnit.MINUTES,strategy = LimitStrategyEnum.Ip)
    public R test(){
        return R.success();
    }
}
